import { useState } from 'react';
import { Tabs, TabPane } from '@douyinfe/semi-ui';
import { Type } from './interface';
import Login from './components/Login';
import Register from './components/Register';

export default function LoginAndRegister() {
    const [type, setType] = useState(Type.Login);

    return (
        <div>
            <Tabs
                onChange={active => {
                    setType(active as Type);
                }}
                activeKey={type}
            >
                <TabPane tab="登录" itemKey={Type.Login}>
                    <Login></Login>
                </TabPane>
                <TabPane tab="注册" itemKey={Type.Register}>
                    <Register />
                </TabPane>
            </Tabs>
        </div>
    );
}
